Skip to content

Decisions page: localStorage draft persistence (#8777) - #8778

Merged
dezren39 merged 1 commit into
mainfrom
decisions-draft-persistence
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
decisions-draft-persistence

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes the typed-work half of #8777 (the 2026-11-11 decisions-page "crash": pm-aggregator + pm-dispatch were SIGTERM'd mid-session; the page JS was not at fault, but everything Drew had typed and not yet submitted existed only in form fields).

What

  • src/decisions.ts: new decisionsDraftScript(setId) — the page-side draft script, working purely off the page's existing DOM contract. In-progress answers, comments, defer picks (incl. guided picks), request-info notes, bulk checkboxes and the bulk bar are saved to localStorage["decisions-drafts:<setId>"] on every input/change and restored on load. A MutationObserver re-save prunes drafts for questions whose blocks leave the DOM when recorded, so a stale draft can never resurrect. All storage access is try/caught — drafts are best-effort and can never break the page.
  • src/server.ts: renderDecisionsPage interpolates the draft script as the page script's last block.
  • test/decisions.test.ts: 4 regression tests (Decisions page 'crash' 2026-11-11: pm-aggregator + pm-dispatch SIGTERM'd mid-session, no self-heal (Restart=on-failure treats SIGTERM as clean) #8777) — esc() neutralizes script/attribute breakout text; draft key is per-set; the draft script parses as JS and embeds only its own set's key; save/restore/prune wiring is present.

Verification

The service-death half of #8777 (Restart=always drop-ins for pm-aggregator + pm-dispatch) is laptop config, applied and verified separately — evidence on the issue.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 22:09
@dezren39
dezren39 merged commit d16e8e6 into main Nov 11, 2026
1 check failed
@dezren39
dezren39 deleted the decisions-draft-persistence branch November 11, 2026 22:09
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86d3fbc2-63f5-43c9-9834-bf1aeffbb80a
Commits

Reviewing files that changed from the base of the PR and between 67d9d90 and b20ce83.

Files selected for processing: 3

  • pm-stack/aggregator/src/decisions.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/test/decisions.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T22:10:57.951297Z b20ce83 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant